package org.polaris.authority.listener;

import org.polaris.authority.service.IPermissionScanService;
import org.springframework.beans.factory.annotation.Autowired;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.annotation.WebListener;

@WebListener
public class InitDataListener implements ServletContextListener {

    @Autowired
    private IPermissionScanService permissionScanService;

    //容器初始化执行
    @Override
    public void contextInitialized(ServletContextEvent sce) {

        System.out.println("==========初始化开始==========");
        //permissionScanService.scan();
        System.out.println("==========初始化结束==========");
    }

    //容器销毁时执行
    @Override
    public void contextDestroyed(ServletContextEvent sce) {
        System.out.println("==========容器销毁==========");
    }
}
